//
//  GKStatusBottomView.swift
//  MicroBlogFunc
//
//  Created by GK on 16/4/14.
//  Copyright © 2016年 GK. All rights reserved.
//

import UIKit

class GKStatusBottomView: UIView {

    required init?(coder aDecoder: NSCoder)
    {
        fatalError("init(coder:) has not been implemented")
    }

    override init(frame: CGRect)
    {
        super.init(frame: frame)
        prepareUI()
    }
    
    //添加子控件
    private func prepareUI()
    {
        addSubview(btnRetweet)
        addSubview(btnComment)
        addSubview(btnLike)
        addSubview(splitLine1)
        addSubview(splitLine2)
        
        //添加约束
        btnRetweet.snp_makeConstraints { (make) in
            make.leading.top.bottom.equalTo(self)
        }
        
        btnComment.snp_makeConstraints { (make) in
            make.leading.equalTo(btnRetweet.snp_trailing)
            make.top.bottom.equalTo(self)
            //与左边的btnretweet等宽
            make.width.equalTo(btnRetweet)
        }
        
        btnLike.snp_makeConstraints { (make) in
            make.leading.equalTo(btnComment.snp_trailing)
            make.top.trailing.bottom.equalTo(self)
            //与左边的btnretweet相等
            make.width.equalTo(btnRetweet)
        }
        
        splitLine1.snp_makeConstraints { (make) in
            make.centerX.equalTo(btnRetweet.snp_trailing)
            make.centerY.equalTo(btnRetweet)
        }
        splitLine2.snp_makeConstraints { (make) in
            make.centerX.equalTo(btnComment.snp_trailing)
            make.centerY.equalTo(btnComment)
        }
        
    }
    
    
    
    
    
    
    //懒加载
    //转发按钮
    private lazy var btnRetweet: UIButton = UIButton(imgStr: "timeline_icon_retweet", title: "转发")
    //评论按钮
    private lazy var btnComment: UIButton = UIButton(imgStr:"timeline_icon_comment", title: "评论")
    //赞按钮
    private lazy var btnLike: UIButton = UIButton(imgStr: "timeline_icon_unlike", title: "赞")
    //分割线1
    private lazy var splitLine1 : UIImageView = UIImageView(imgStr: "timeline_card_bottom_line")
    //分割线2
    private lazy var splitLine2 : UIImageView = UIImageView(imgStr: "timeline_card_bottom_line")
    
    
}
